import { KeepAlive } from "vue";
import { createRouter, createWebHashHistory } from "vue-router";

const routers = [
    {
        path:"/login",
        name:'login',
        component: () => import('@/views/login/index.vue'),
    },
    {
        path:"/SelectCity",
        name:'SelectCity',
        component: () => import('@/views/home/componets/SelectCity.vue'),
    },
    {
        path:"/feedback",
        name:'feedback',
        component: () => import('@/views/feedback/index.vue'),
    },
    {
        path: "/moviedtail",
        name: "moviedtail",
        meta:{
            activeNum:0,
            keepAlive: false
        },
        component: ()=>import ('@/views/home/movie_dtail/MovieDtail.vue')
    },
    {
        path: "/UpUserInfo",
        name: "UpUserInfo",
        meta:{
            activeNum:0,
            keepAlive: false
        },
        component: ()=>import ('@/views/my/component/UpdateUserInfo.vue')
    },
    {
        path: "/UserSettings",
        name: "UserSettings",
        meta:{
            activeNum:0,
            keepAlive: false
        },
        component: ()=>import ('@/views/my/component/UserSettings.vue')
    },
    {
        path: "/VersionPage",
        name: "VersionPage",
        meta:{
            activeNum:0,
            keepAlive: false
        },
        component: ()=>import ('@/views/my/component/settingsComponent/VersionPage.vue')
    },
    {
        path: '/',
        component: () => import('@/views/tab-bar/index.vue'),
        children: [
            {
                path: "",
                name: "Home",
                meta:{
                    activeNum:0,
                    keepAlive: true
                },
                component: ()=>import ('@/views/home/movie_home.vue')
            },
            
            {
                path: "/community",
                name: "community",
                meta:{
                    activeNum:1,
                    keepAlive: true
                },
                component: ()=>import ('@/views/community/index.vue')
            },
            {
                path: "/welfare",
                name: "welfare",
                meta:{
                    activeNum:2,
                    keepAlive: true
                },
                component: ()=>import ('@/views/welfare/index.vue')
            },
            {
                path: "/my",
                name: "my",
                meta:{
                    activeNum:3,
                    keepAlive: true
                },
                component: ()=>import ('@/views/my/index.vue')
            }
            
           
        ]
    }
    
   
]

const router = createRouter({
    history:createWebHashHistory(),
    routes:routers
})

export default router